﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Devonline.Core;

namespace Devonline.Entity
{
    /// <summary>
    /// 字符串类型的默认基类
    /// </summary>
    public abstract class EntitySetWithBusiness : EntitySetWithBusiness<string>
    {
    }

    /// <summary>
    /// 业务数据对象模型的抽象基类
    /// </summary>
    public abstract class EntitySetWithBusiness<TKey> : EntitySetWithCreate<TKey>, IEntitySetWithBusiness<TKey> where TKey : IConvertible
    {
        /// <summary>
        /// 业务名称
        /// </summary>
        [Column("name"), DisplayName("名称"), Required, MaxLength(128), Excel]
        public virtual string Name { get; set; }
        /// <summary>
        /// 业务类型
        /// </summary> 
        [Column("business_type"), DisplayName("业务类型"), Required, MaxLength(36), Excel]
        public virtual string BusinessType { get; set; }
        /// <summary>
        /// 业务主键
        /// </summary>
        [Column("business_key"), DisplayName("业务主键"), Required, MaxLength(36), Excel]
        public virtual TKey BusinessKey { get; set; }
    }
}
